home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / me_cd25.zip / MUTT2.ZIP / XTERM.MUT < prev   
Text File  |  1992-11-09  |  897b  |  43 lines

  1.   ;; xterm.mut : intercept and map function keys for VT100 like terminals
  2.   ;; C Durland    Public Domain
  3.  
  4. (defun
  5.   sofkeys    ; soft keys: ESC [ ...
  6.   {
  7.     (string c)
  8.  
  9.     (exe-key
  10.       (switch (getchar)
  11.     "A" 0x843    ; Up arrow
  12.     "B" 0x844    ; Down arrow
  13.     "D" 0x846    ; Left arrow
  14.     "C" 0x845    ; Right arrow
  15.     "$" 0x84A    ; Next
  16.     ""  0x841    ; Home
  17.     "4" { (getchar) 0x84E }    ; select: ESC [ 4 ~
  18.     "5" { (getchar) 0x849 }    ; Prev:   ESC [ 5 ~
  19.     "6" { (getchar) 0x84A }    ; Next:   ESC [ 6 ~
  20.     "1"        ; Functions keys: ESC [ 1 x ~
  21.       {
  22.         (c (getchar))(getchar)
  23.         (switch c
  24.           "1" 0x831        ; f1
  25.           "2" 0x832        ; f2
  26.           "3" 0x833        ; f3
  27.           "4" 0x834        ; f4
  28.           "5" 0x835        ; f5
  29.           "7" 0x836        ; f6
  30.           "8" 0x837        ; f8
  31.           "9" 0x838        ; f9
  32.         )
  33.       }
  34.     default { (msg "Unknown key")(done) }
  35.       )
  36.     )
  37.   }
  38.   MAIN
  39.   {
  40.     (bind-to-key "sofkeys" "^[[")
  41.   }
  42. )
  43.